/*
 * --------------------------------------------------------------
 * Copyright ©  2015 Hangzhou DtDream Technologies Co.,Ltd.
 * --------------------------------------------------------------
 *      Product: 协同数治
 *  Module Name: design
 * Date Created: 2023/2/24
 *  Description: TODO
 * --------------------------------------------------------------
 * Modification History
 * DATE            NAME            Description
 * --------------------------------------------------------------
 * 2023/2/24       yewj            TODO
 * --------------------------------------------------------------
 */

package com.dtdream.pattern.iterator;

import java.util.Iterator;

/**
 * TODO
 *
 * @Author: yewj
 **/
public class ComputerCollegeIterator implements Iterator {

    private Department[] departments;
    private int position = 0;

    public ComputerCollegeIterator(Department[] departments) {
        this.departments = departments;
    }

    @Override
    public boolean hasNext() {
        if (position >= departments.length || departments[position] == null) {
            return false;
        } else {
            return true;
        }
    }

    @Override
    public Object next() {
        departments[position] = departments[position];
        position += 1;
        return departments;
    }

    @Override
    public void remove() {

    }
}
